/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.acworks.acroute.v2.impl;

import com.acworks.acroute.v2.Graph;
import com.acworks.acroute.v2.Node;
import com.acworks.acroute.v2.NodeType;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author nikita
 */
public class NodeImpl2 implements Node {

    final private int id;
    final private NodeType type;
    final private Set<Node> successors;
/*
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final NodeImpl2 other = (NodeImpl2) obj;
        if (this.id != other.id) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 67 * hash + this.id;
        return hash;
    }
*/
    public NodeImpl2(int nodeId, NodeType nodeType) {
        assert nodeType != null;
        id = nodeId;
        successors = new HashSet<Node>(4);
        this.type = nodeType;
    }

    @Override
    public Graph getGraph() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Set<Node> getSuccessors() {
        return successors;
    }

    @Override
    public int getId() {
        return id;
    }

    @Override
    public int compareTo(Node node) {
        return this.id - node.getId();
    }

    @Override
    public String toString() {
        return super.toString() + "[id=" + id + "]";
    }

    @Override
    public NodeType getType() {
        return type;
    }
}
